package xyz.zq.sf.common.core.util;

import cn.hutool.core.util.StrUtil;
import lombok.experimental.UtilityClass;

import java.util.regex.Pattern;

/**
 * 正则合集
 *
 * @author hzq
 * @date 2021-02-19 10:21
 */
@UtilityClass
public class PatternUtil {

    public static Pattern UUID_Pattern = Pattern.compile("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$");

    public static boolean isUUID(CharSequence uuid) {
        if (StrUtil.isBlank(uuid))
            return false;
        return UUID_Pattern.matcher(uuid).matches();
    }


}
